<?php

namespace App\Admin\Validate\AdminUser;

use App\Common\Validate\BaseValidate;

/**
 * 权限组验证器
 */
class AdminUser extends BaseValidate
{
    //验证规则
    protected $rule = [
        'username' => 'required|string|min:2|max:20',
        'real_name' => 'required|string|min:2|max:20',
        'mobile' => ['required', 'regex:/^1[3-9]\d{9}$/'],
    ];
    //自定义验证信息
    protected $message = [
        'username.required' => '用户名称不能为空',
        'username.min' => '用户名长度不能小于2位',
        'username.max' => '用户名长度不能大于20位',
        'real_name.required' => '姓名不能为空',
        'real_name.min' => '姓名长度不能小于2位',
        'real_name.max' => '姓名长度不能大于20位',
        'mobile.required' => '用户手机号',
        'mobile.regex'=>'手机号不规范'
    ];
}
